package com.trkj.usercenter;

import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.SwitchPreference;

import com.shamanland.fonticon.FontIconDrawable;
import com.trkj.taoruiyun.R;

/**
 * Created by LiZanhong on 2015/06/21.
 */
public class SetupFragment extends PreferenceFragment
        implements Preference.OnPreferenceChangeListener{
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.preference_setup);

        SwitchPreference prefShowImage = (SwitchPreference) findPreference("show_image");
        prefShowImage.setOnPreferenceChangeListener(this);
        prefShowImage.setIcon(FontIconDrawable.inflate(getActivity(), R.xml.pref_image_icon));

        SwitchPreference prefHeaderType = (SwitchPreference) findPreference("header_image_type");
        prefHeaderType.setOnPreferenceChangeListener(this);
        prefHeaderType.setIcon(FontIconDrawable.inflate(getActivity(), R.xml.pref_header_icon));
    }


    @Override
    public boolean onPreferenceChange(Preference preference, Object newValue) {
        return true;
    }
}
